﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AMicroblogAPI;
using AMicroblogAPI.Common;
using AMicroblogAPI.DataContract;

namespace weibo
{
    public partial class CommentA : Form
    {
        private long statusID;
        public CommentA(long id)
        {
            statusID = id;
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnComment_Click(object sender, EventArgs e)
        {
            string text = tbcomment.Text.Trim();
            AMicroblog.Comment(statusID, text);
            this.Close();
        }

        private void tbcomment_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbcomment.Text.Trim()))
            {
                btnComment.Enabled = false;
            }
            else
            {
                btnComment.Enabled = true;
            }
        }
    }
}
